/**
 * @Author: qinlong
 * @Date:   2018-04-27T15:14:31+08:00
 * @Last modified by:   pikaz
 * @Last modified time: 2018-05-03T18:17:47+08:00
 */

Component({
  properties: {
    navListItem: {
      type: null,
      value: ''
    }
  },
  data: {
    pickerValue: -1,
    date: '2018-10-01',
    time: '12:00',
    dateTimeArray: null,
    dateTime: null,
    dateTimeArray1: null,
    dateTime1: null,
    startYear: '',
    endYear: ''
  },
  attached() {
    var nowDate = new Date();
    var obj1={};
    // 获取完整的年月日 时分秒，以及默认显示的数组 
    // var obj = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
    var nowDate = new Date();
    var year = nowDate.getFullYear();
    this.setData({
      startYear: '1980-01-01',
      endYear: year + '-' + (nowDate.getMonth() * 1 + 1) + '-' + nowDate.getDate()
    })
    
  },
  methods: {
    goTo: function (e) {
      wx.navigateTo({
        url: e.currentTarget.dataset.url
      })
    },
    _input: function(e) {
      var index = e.currentTarget.dataset.index;
      var value = e.detail.value;
      this.triggerEvent('event', {
        index,
        value
      })
      
    },
    _change: function(e) {
      var index = e.currentTarget.dataset.index;
      var value = e.detail.value;
      this.setData({
        pickerValue: value
      })
      this.triggerEvent('changeEvent', {
        index,
        value
      })
    },
    _selectTime:function(e){
      var index = e.currentTarget.dataset.index;
      var value = e.detail.value;
      console.log("正在改变")
      this.setData({
        pickerValue: value
      })
      this.triggerEvent('changeTime', {
        index,
        value
      })
    }
  }
})